<%@ page language="java" isELIgnored="false" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@ include file="/WEB-INF/jsp/ResourceGlobal.jsp"%>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>修改主消息配置</title>
		<script type="text/javascript">
		var pagePath = '<%=context%>';
		var msgConfSendType='${msgConf.sendType}';
		//默认加载
		$(function(){
			//把访问路径传到js
			setPathPrefix(pagePath);
		});
		</script>
		<script type="text/javascript" src="<%=context%>resources/modules/system/sys/msg/msgConf.update.js?r=<%=Math.random()%>"></script>
	</head>
	<body class="sub-page">
		<form  name="updateForm" id="updateForm"  role="form"   method="post" class="form-horizontal" action="<%=context%>msgconf/updateMsgConf.do"  >
 			<fieldset>
 				<div class="page-content">
	    			<div class="page-header">
	        			<h4 class="page-title">修改主消息配置</h4>
	    			</div>
		    		<div class="page-body">
		            	<div class="form-group">
		                	<label class="col-sm-2 control-label">标题<span class="text-danger">*</span></label>
		                	<div class="col-sm-10">
		                		<input type="hidden" name="id" id="id" value="${msgConf.id}"/>
		                		<input type="text" name="title" id="title" value="${msgConf.title}" placeholder="请输入标题" class="form-control" >
		                	</div>
		            	</div>
	            	
		            	<div class="form-group">
		                	<label class="col-sm-2 control-label">消息代码<span class="text-danger">*</span></label>
		                	<div class="col-sm-10 form-inner">
		                		<input type="hidden" id="oldMsgCode" value="${msgConf.msgCode}">
		                		<input type="text" name="msgCode" id="msgCode" value="${msgConf.msgCode}" placeholder="请输入消息代码" class="form-control" >
		                	</div>
		            	</div>
	            	
		            	<div class="form-group">
		                	<label class="col-sm-2 control-label">发送类型<span class="text-danger">*</span></label>
		                	<div class="col-sm-10 form-inner" id="sendTypeList">
			                   		<input type="radio" name="sendType" id="sendTypeNotice" value="Notice" <c:if test="${msgConf.sendTypeNotice=='Notice'}">checked</c:if>/><label for="sendTypeNotice">通知</label>
									<input type="radio" name="sendType" id="sendTypeEmail" value="Email" <c:if test="${msgConf.sendTypeEmail=='Email'}">checked</c:if>/><label for="sendTypeEmail">邮件</label>
									<input type="radio" name="sendType" id="sendTypeBacklog" value="Backlog" <c:if test="${msgConf.sendTypeBacklog=='Backlog'}">checked</c:if>/><label for="sendTypeBacklog">待办</label>
									<input type="radio" name="sendType" id="sendTypeSms" value="Sms" <c:if test="${msgConf.sendTypeSms=='Sms'}">checked</c:if>/><label for="sendTypeSms">短信</label>
									<input type="radio" name="sendType" id="sendTypeWeChat" value="WeChat" <c:if test="${msgConf.sendTypeWeChat=='WeChat'}">checked</c:if>/><label for="sendTypeWeChat">微信</label>
		                	</div>
		            	</div>
            		
		            	<div class="form-group">
		                	<label class="col-sm-2 control-label">排序号<span class="text-danger">*</span></label>
		                	<div class="col-sm-10">
		                		<input class="form-control" type="text" name="sortNo" id="sortNo" value="${msgConf.sortNo}" 
								onkeyup="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}" 
								onafterpaste="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}"/>
		                	</div>
		            	</div>
		            	
		            	<div class="form-group">
		                	<label class="col-sm-2 control-label">触发条件<span class="text-danger">*</span></label>
		                	<div class="col-sm-10">
		                		<input type="text"  name="triggerDate" id="triggerDate"  value="${msgConf.triggerDate}" class="form-control" >
		                	</div>
		            	</div>
		            	
			            <div id="NoticeType" style="display: none;">	
			            	<div class="form-group">
			                	<label class="col-sm-2 control-label">通知标题模板<span class="text-danger">*</span></label>
			                	<div class="col-sm-10">
			                		<input type="text"  name="noticeTitleTemplate" id="noticeTitleTemplate" value="${msgConf.noticeTitleTemplate}"  class="form-control" >
			                	</div>
			            	</div>
			            	
			            	<div class="form-group">
			                	<label class="col-sm-2 control-label">通知内容模板<span class="text-danger">*</span></label>
			                	<div class="col-sm-10">
			                    	<textarea name="noticeContentTemplate" id="noticeContentTemplate" class="form-control" rows="10">${msgConf.noticeContentTemplate}</textarea>
			                	</div>
			            	</div>
			            </div>
		            
			            <div id="EmailType" style="display: none;">	
			            	<div class="form-group">
			                	<label class="col-sm-2 control-label">短信标题模板<span class="text-danger">*</span></label>
			                	<div class="col-sm-10">
			                		<input type="text"  name="emailTitleTemplate" id="emailTitleTemplate" value="${msgConf.emailTitleTemplate}"  class="form-control" >
			                	</div>
			            	</div>
			            	
			            	<div class="form-group">
			                	<label class="col-sm-2 control-label">短信内容模板<span class="text-danger">*</span></label>
			                	<div class="col-sm-10">
			                    	<textarea name="emailContentTemplate" id="emailContentTemplate" class="form-control" rows="10">${msgConf.emailContentTemplate}</textarea>
			                	</div>
			            	</div>
			            	
			            </div>	
		            
			            <div id="SmsType" style="display: none;">		
			            	<div class="form-group">
			                	<label class="col-sm-2 control-label">SMS内容模板<span class="text-danger">*</span></label>
			                	<div class="col-sm-10">
			                		<input type="text"  name="smsContentTemplate" id="smsContentTemplate" value="${msgConf.smsContentTemplate}"  class="form-control" >
			                	</div>
			            	</div>
			            </div>
		            
			            <div id="BacklogType" style="display: none;">	
			            	<div class="form-group">
			                	<label class="col-sm-2 control-label">待办标题模板<span class="text-danger">*</span></label>
			                	<div class="col-sm-10">
			                		<input type="text"  name="backlogTitleTemplate" id="backlogTitleTemplate" value="${msgConf.backlogTitleTemplate}"  class="form-control" >
			                	</div>
			            	</div>
			            	<div class="form-group">
			                	<label class="col-sm-2 control-label">待办内容模板<span class="text-danger">*</span></label>
			                	<div class="col-sm-10">
			                    	<textarea name="backlogContentTemplate" id="backlogContentTemplate" class="form-control" rows="10">${msgConf.backlogContentTemplate}</textarea>
			                	</div>
			            	</div>
			            	<div class="form-group">
			                	<label class="col-sm-2 control-label">待办对应菜单<span class="text-danger">*</span></label>
			                	<div class="col-sm-10 form-inner">
									<select name="backlogMenu" id="backlogMenu" class="form-control use-select2" >
											<option value="" <c:if test="${msgConf.backlogMenu=='' }">selected</c:if> >无</option>
											<c:forEach var="obj" items="${rootMenu }">
												<option value="${obj.menuId }" <c:if test="${msgConf.backlogMenu==obj.menuId}">selected</c:if>>${obj.name }</option>
												<c:forEach var="o" items="${obj.childs }">
													<option value="${o.menuId }" <c:if test="${msgConf.backlogMenu==o.menuId}">selected</c:if>>|-&nbsp;${o.name }</option>
													<c:forEach var="c" items="${o.childs }">
														<option value="${c.menuId }" <c:if test="${msgConf.backlogMenu==c.menuId}">selected</c:if> > &nbsp;&nbsp;&nbsp;|--&nbsp;${c.name }</option>
													</c:forEach>
												</c:forEach>
											</c:forEach>
									</select>
								</div>
			            	</div>
			            	<div class="form-group">
			                	<label class="col-sm-2 control-label">待办路径<span class="text-danger">*</span></label>
			                	<div class="col-sm-10">
			                		<input type="text"  name="backlogUrl" id="backlogUrl" value="${msgConf.backlogUrl}"  class="form-control" >
			                	</div>
			            	</div>
			            	<div class="form-group">
			                	<label class="col-sm-2 control-label">待办页面路径<span class="text-danger">*</span></label>
			                	<div class="col-sm-10">
			                		<input type="text"  name="backlogPageUrl" id="backlogPageUrl" value="${msgConf.backlogPageUrl}"  class="form-control" >
			                	</div>
			            	</div>
			            	<div class="form-group">
			                	<label class="col-sm-2 control-label">待办参数及值<span class="text-danger">*</span></label>
			                	<div class="col-sm-10">
			                		<textarea name="backlogParameter" id="backlogParameter" class="form-control" rows="10">${msgConf.backlogParameter}</textarea>
			                	</div>
			            	</div>
			            </div>	
		            
			            <div id="WeChatType" style="display: none;">	
			            	<div class="form-group">
			                	<label class="col-sm-2 control-label">微信内容模板<span class="text-danger">*</span></label>
			                	<div class="col-sm-10">
			                    	<textarea name="weChatContentTemplate" id="weChatContentTemplate" class="form-control" rows="10">${msgConf.weChatContentTemplate}</textarea>
			                	</div>
			            	</div>
			            </div>	
		            	
		            	<div class="form-group">
		                	<label class="col-sm-2 control-label">备注</label>
		                	<div class="col-sm-10">
		                    	<textarea name="remark" id="remark" class="form-control" rows="10">${msgConf.remark}</textarea>
		                	</div>
		            	</div>
		            	
		            	<div class="page-header">
		        			<h4 class="page-title">收件人</h4>
		    			</div>
		    			<div class="page-body">
		    			
			            	<div class="form-group">
			                	<label class="col-sm-2 control-label">用户名称</label>
			                	<div class="col-sm-10 form-inner">
			                  		<select name="msgEmpConfVoR.empIds" id="empIdsR" placeholder="收件人" multiple="multiple"  val="${msgEmpConfR.empIds}" text="${msgEmpConfR.empIdsNM}"></select>
			                	</div>
			            	</div>
			            	
			            	<div class="form-group">
			                	<label class="col-sm-2 control-label">特殊通知人</label>
			                	<div class="col-sm-10 form-inner">
			                		<div>
										<label><input type="checkbox" name="msgEmpConfVoR.specialEmps" id="specialEmpsM" value="M" <c:if test="${msgEmpConfR.specialEmpsM == 'M'}">checked</c:if>/>主管</label>
										<label><input type="checkbox" name="msgEmpConfVoR.specialEmps" id="specialEmpsS" value="S" <c:if test="${msgEmpConfR.specialEmpsS == 'S'}">checked</c:if>/>指定处理人</label>
										<label><input type="checkbox" name="msgEmpConfVoR.specialEmps" id="specialEmpsD" value="D" <c:if test="${msgEmpConfR.specialEmpsD == 'D'}">checked</c:if>/>默认处理人</label>
										<label><input type="checkbox" name="msgEmpConfVoR.specialEmps" id="specialEmpsT" value="T" <c:if test="${msgEmpConfR.specialEmpsT == 'T'}">checked</c:if>/>转办委托人</label>
			                		</div>
			                	</div>
			            	</div>
			            	
			            	<div class="form-group">
			                	<label class="col-sm-2 control-label">公共邮箱</label>
			                	<div class="col-sm-10">
			                		<select name="publicEmailIdsR" id="publicEmailIdsR" multiple="multiple"  val="${publicEmailIdsR}" text="${publicEmailNamesR}"></select>
			                	</div>
			            	</div>
			            </div>
		            	
		            	<div class="page-header">
		        			<h4 class="page-title">抄送人</h4>
		    			</div>
		    			<div class="page-body">
			    			
			            	<div class="form-group">
			                	<label class="col-sm-2 control-label">用户名称</label>
			                	<div class="col-sm-10 form-inner">
			                  		<select name="msgEmpConfVoC.empIds" id="empIdsC"  placeholder="抄送人" multiple="multiple"  val="${msgEmpConfC.empIds}" text="${msgEmpConfC.empIdsNM}"></select>
			                	</div>
			            	</div>
			            	
			            	<div class="form-group">
			                	<label class="col-sm-2 control-label">特殊通知人</label>
			                	<div class="col-sm-10 form-inner">
			                		<div>
										<label><input type="checkbox" name="msgEmpConfVoC.specialEmps" id="specialEmpsM" value="M" <c:if test="${msgEmpConfC.specialEmpsM == 'M'}">checked</c:if>/>主管</label>
										<label><input type="checkbox" name="msgEmpConfVoC.specialEmps" id="specialEmpsS" value="S" <c:if test="${msgEmpConfC.specialEmpsS == 'S'}">checked</c:if>/>指定处理人</label>
										<label><input type="checkbox" name="msgEmpConfVoC.specialEmps" id="specialEmpsD" value="D" <c:if test="${msgEmpConfC.specialEmpsD == 'D'}">checked</c:if>/>默认处理人</label>
										<label><input type="checkbox" name="msgEmpConfVoC.specialEmps" id="specialEmpsT" value="T" <c:if test="${msgEmpConfC.specialEmpsT == 'T'}">checked</c:if>/>转办委托人</label>
			                		</div>
			                	</div>
			            	</div>
			            	
			            	<div class="form-group">
			                	<label class="col-sm-2 control-label">公共邮箱</label>
			                	<div class="col-sm-10">
			                		<select name="publicEmailIdsC" id="publicEmailIdsC" multiple="multiple"  val="${publicEmailIdsC}" text="${publicEmailNamesC}"></select>
			                	</div>
			            	</div>
			            </div>
			
		    		</div>
				    <div class="page-footer">
				         <button type="button" name="commitBtn" id="commitBtn" class="btn btn-primary" onClick="submitCheck();">提交</button>
				         <button type="button" name="cancelBtn" id="cancelBtn" class="btn btn-link" data-dismiss="modal"  onclick="window.close();" >取消</button>
				    </div>
				</div>
			</fieldset>
		</form>
	</body>
</html>
